<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>模板语句的数据来源</title>
    <!-- 安装vue：当你使用script进行vue安装之后，上下文就注册了一个全局变量 Vue -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <div id="app">

           <h1>{{msg}}</h1> 

    </div>

    <script>
        const myVue = new Vue({
            template: '<h1>今天是{{currentTime}},我见了{{name}}</h1>',
            data: {
                name:'李白',
                currentTime: new Date()
            }
        })

        /*
         1. $mount将vue实列挂载到id=app的元素位置   
        */
        myVue.$mount('#app')
    </script>
</body>

</html>